package com.gem.day06.extend1;

import java.time.LocalDate;

/**员工父类*/
//Object是Java顶级父类,所有类都是直接或者间接继承它的
public class Employee {
	//共性属性,所有子类都可以共享
	private String name;
	private LocalDate birthday;

	//注意:此处不能写特有属性,特有属性要写在子类中!

	public Employee() {

	}

	public Employee(String name, LocalDate birthday) {
		super();
		this.name = name;
		this.birthday = birthday;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public LocalDate getBirthday() {
		return birthday;
	}

	public void setBirthday(LocalDate birthday) {
		this.birthday = birthday;
	}

	@Override
	public String toString() {
		return "姓名: " + name + ",生日: " + birthday;
	}

	public double getSalary(int month) {
		double salary = 0.0;
		if (birthday.getMonth().getValue() == month) {
			salary += 100;
		}
		return salary;
	}
}
